<div  id="content" class="lottery-box">
    <lottery-header ng-if="lotteryCtrl.lotteryType=='cqssc' || lotteryCtrl.lotteryType=='gd11x5'"></lottery-header>
    <iframe ng-if="lotteryCtrl.lotteryType=='xysc'"  src="/animate/xysc.html" frameborder="0" width="100%" height="420px"></iframe>
    <!--幸运赛车 -->
    <ul class="nav nav-tabs ">
        <li  ng-repeat="typeLevel1V in lotteryCtrl.lotteryInfo.typeLevel1" ng-class="{'active':($index==0)}" ng-click="lotteryCtrl.changeTypeLevel1Tab(typeLevel1V.key)"><a href="" data-toggle="tab">{{typeLevel1V.name}}</a></li>
    </ul>
    <div id="cqssc_content" class="tab-content">
        <!--定位胆-->
        <div class="typeLevel1VArea tab-pane fade in" ng-class="{'active':(typeLevel1Index==0)}" id="{{typeLevel1V.key}}" ng-init="typeLevel1Index = $index" ng-repeat="typeLevel1V in lotteryCtrl.lotteryInfo.typeLevel1">
            <div class="col-lg-9 col-md-9">
                <div class="row">
                    <div class="col-lg-12 col-md-12">
                        {{typeLevel1V.name}}：
                        <button class="btn btn-small btn-radius typelevel2Button {{typeLevel2V.key}}" ng-class="{'btn-warning':(typeLevel1Index==0&&typeLevel2Index==0)}" ng-click="lotteryCtrl.changeTypeLevel2Tab(typeLevel1V.key,typeLevel2V.key)"  ng-init="typeLevel2Index = $index" ng-repeat="typeLevel2V in typeLevel1V.typeLevel2" data-typeLevel2="{{typeLevel2V.key}}">{{typeLevel2V.name}}</button>
                    </div>
                </div>
                <div class="typeLevel2Area {{typeLevel2V.key}}" data-typeLevel2="{{typeLevel2V.key}}" ng-class="{'show':(typeLevel1Index==0&&typeLevel2Index==0),'hide':(typeLevel1Index==0&&typeLevel2Index>0)}"  ng-init="typeLevel2Index = $index" ng-repeat="typeLevel2V in typeLevel1V.typeLevel2">
                    <div class="row" style="font-size: 12px;">
                        <div class="col-lg-12 col-md-12">
                            <span>{{typeLevel2V.desc}}</span><span ng-show="typeLevel2V.prize">赔率：{{typeLevel2V.prize}}</span>
                        </div>
                    </div>
                    <div class="row" style="min-height: 370px;">
                        <div style="min-height: 200px;">
                            <div class="row play-aera" ng-repeat="ballType in typeLevel2V.ballsTypeList" data-key="{{ballType.key}}" ng-init="showShortcutKey=typeLevel2V.showShortcutKey">
                                <div class="col-lg-1 col-md-1">
                                    <span class="label">{{ballType.name}}</span>
                                </div>
                                <div class="col-lg-11 col-md-11">
                                    <div class="balls">
                                        <ul id="ul_balls_{{ballType.key}}" class="ul_balls" data-ballrow="{{ballType.name}}">
                                            <li ng-repeat="ball in ballType.balls " data-ballvalue="{{ball.key}}" ng-click="lotteryCtrl.selectABall($event)">{{ball.value}}</li>
                                        </ul>
                                    </div>
                                    <div class="tool pull-right" ng-class="{'show':showShortcutKey,'hide':!showShortcutKey}">
                                        <ul class="numberPay" data-key="{{ballType.key}}">
                                            <li ng-show="typeLevel2V.showFull" ng-click="lotteryCtrl.selectAllBalls(typeLevel2V.key,ballType.key)"><span>全</span></li>
                                            <li ng-show="typeLevel2V.showBig" ng-click="lotteryCtrl.selectBigBalls(typeLevel2V.key,ballType.key)"><span>大</span></li>
                                            <li ng-show="typeLevel2V.showSmall" ng-click="lotteryCtrl.selectSmallBalls(typeLevel2V.key,ballType.key)"><span>小</span></li>
                                            <li ng-show="typeLevel2V.showOdd" ng-click="lotteryCtrl.selectOddBalls(typeLevel2V.key,ballType.key)"><span>奇</span></li>
                                            <li ng-show="typeLevel2V.showEven" ng-click="lotteryCtrl.selectEvenBalls(typeLevel2V.key,ballType.key)"><span>偶</span></li>
                                            <li ng-show="typeLevel2V.showClean" ng-click="lotteryCtrl.selectCleanBalls(typeLevel2V.key,ballType.key)"><span>清</span></li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- 选择注数、单位并计算需要费用预计奖金 -->
                        <div class="row unit_row">
                            <div class="col-lg-12 col-md-12" style="text-align: center">
                                <input class="input input-inline" type="number" ng-model="lotteryCtrl.betCalcInfo.times" name="times" id="times" ng-change="lotteryCtrl.checkTimesValue(event)">
                                <ul style="position: relative;transform: translateY(40%);">
                                    <li style="margin-bottom: 3px;">
                                        <button id="times_add" ng-click="lotteryCtrl.addLotteryTimes()">+</button>
                                    </li>
                                    <li>
                                        <button id="times_minus" ng-click="lotteryCtrl.minusLotteryTimes()">-</button>
                                    </li>
                                </ul>
                                <span>选了&nbsp;<b id="info_result_nums" class="text-orange-num">{{lotteryCtrl.betCalcInfo.itemCount}}</b>&nbsp;注&nbsp;
                                    <b id="info_result_nums" class="text-orange-num">{{lotteryCtrl.betCalcInfo.times}}</b>&nbsp;倍&nbsp;共
                                    <b>￥<b id="info_result_money" class="text-orange-num">{{lotteryCtrl.betCalcInfo.totalPrice|currency : '￥'}}</b></b>元</span>
                            </div>
                        </div>
                        <!-- 选择注数、单位并计算需要费用预计奖金 end -->
                        <!--选择彩票 start -->
                        <div class="row actions_pay_or_add">
                            <div class="col-lg-12 col-md-12"
                                 style="text-align: center;padding: 10px 0;">
                                <!--添加号码 -->
                                <button type="button" ng-disabled="checked" class="numberButton" ng-click="lotteryCtrl.addToBetCache()"></button>
                            </div>
                        </div>
                        <!--选择彩票 end -->
                    </div>
                </div><!-- type level 2 area -->
            </div>
            <div class="col-lg-3 col-md-3">
                <!-- 开奖号码列表，中奖用户 start-->
                <div style="border:#E5E5E5 solid 1px;">
                    <div style="color: #ffffff; font-weight: 600;background-color: #4D193F;">开奖公告</div>
                    <table width="100%" style="margin: 5px;">
                        <tr style="font-weight: 500;">
                            <td>期次</td>
                            <td>时间</td>
                            <td>开奖号码</td>
                        </tr>
                        <tr ng-repeat="winningNum in lotteryCtrl.winingNumList">
                            <td>{{winningNum.issue_id}}</td>
                            <td>{{winningNum.award_time}}</td>
                            <td ng-bind-html="winningNum.award_num | lineBallsWrap"></td>
                        </tr>
                    </table>
                </div>
                <div style="border:#E5E5E5 solid 1px;margin-top: 5px;">
                    <div style="color: #ffffff; font-weight: 600;background-color: #4D193F;">中奖排行</div>
                    <table width="100%" style="margin: 5px;">
                        <tr style="font-weight: 500;">
                            <td>排名</td>
                            <td>用户手机</td>
                            <td>中奖金额</td>
                        </tr>
                        <tr ng-repeat="wonUser in lotteryCtrl.wonUserList">
                            <td>{{wonUser.sort_id}}</td>
                            <td>{{wonUser.mobile}}</td>
                            <td style="color: #FF9122;">{{wonUser.prize | currency:"￥"}}</td>
                        </tr>
                    </table>
                </div><!-- 开奖号码列表，中奖用户 end-->
            </div>
        </div>
    </div>
    <div class="lottery-selected row">
        <div class="col-lg-9 col-md-9">
            <div id="ballsCachedForBetting" class="table">
                <div class="lottery_list_tit">
                    <table class="table table-width">
                        <thead>
                            <tr>
                                <td width="15%">玩法</td>
                                <td width="50%">号码</td>
                                <td width="10%">赔率</td>
                                <td width="5%">注</td>
                                <td width="5%">倍</td>
                                <td width="10%">金额</td>
                                <td width="5%">
                                    <button class="fa fa-trash-o pull-right" id="trash" ng-click="lotteryCtrl.trashBetTicketCodeCache()"></button>
                                </td>
                            </tr>
                        </thead>
                    </table>
                </div>
                 <div class="table-scroll">
                    <table class="table table-width">
                        <tbody>
                            <tr ng-repeat="ticketCode in lotteryCtrl.betTicketCodeCache.betTicketCodeCacheList | orderBy:betTime:true">
                                <td width="15%">{{ticketCode.playName}}</td>
                                <td width="50%" class="custom-word-break">{{ticketCode.code}}</td>
                                <td width="10%" class="custom-word-break">{{ticketCode.prize}}</td>
                                <td width="5%">{{ticketCode.itemCount}}</td>
                                <td width="5%">{{ticketCode.multiple}}</td>
                                <td width="10%">{{ticketCode.totalPrice |currency : '￥'}}</td>
                                <td width="5%">
                                    <button class="fa fa-close pull-right" id="close" ng-click="lotteryCtrl.removeBetTicketCodeCacheRow(ticketCode.betTime)"></button>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <div class="col-lg-3 col-md-3">
            <div class="set-right-select">
                <div class="select-dev-rgt">总金额<span class="text-og ng-binding">{{lotteryCtrl.betTicketCodeCache.totalPrice|currency : '￥'}}</span>元</div>
                <button type="button" ng-disabled="checked" class="betButton" ng-click="lotteryCtrl.betFromCacheConfirm()"></button>
            </div>
        </div>
    </div>
</div>
<script type="application/javascript">
    function xysc_alert() {
        layer.open({
           icon:1,
           title:"注意！",
           content:"当前期次投注已经截止，投注时请注意期次！",
           btn:["确定"],
           time: 5000,
           shadeClose:true,
           yes:function (index,layerno) {
               layer.close(index);
               window.location.reload();
           },
           end:function () {
               window.location.reload();
           }
       });
    }
</script>